<!DOCTYPE html>
<html lang="en">
<#import "../common/userLayout.ftl" as layout/>
<@layout.head title=""></@layout.head>
<head>
    <title>个人信息</title>
    <link rel="stylesheet" type="text/css"
          href="${request.contextPath}/assets/user/skinA/css/page/userInfo.css?v=2640100704">
    <script src="${request.contextPath}/assets/user/js/page/userInfo.js?v=4847100704"></script>
</head>
<body>
<div id="background">
    <div id="top">
        <div id="topLeft">
            <div id="headInfo" style="background-image: url('${userInfo.headPhoto}')"></div>
            <div id="wxName">${userInfo.wxName}</div>
        </div>
        <div id="topCenter">
            <div id="userName">
            ${userInfo.name}
            </div>
            <span style="font-size: 12px;" class="fa fa-user-circle"> ${userInfo.roleName}</span>
            <#--<div id="orgName" class="fa fa-building"> ${userInfo.orgName}</div>-->
        </div>
        <div id="topRight">
            <span class="fa fa-sign-out-alt"></span>
        </div>
    </div>

    <div class="box weui-cells__title">* 为必填项目</div>
    <div class="box weui-cells weui-cells_form">
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">* 昵称</label></div>
            <div class="weui-cell__bd">
                <input class="weui-input" id="name" value="${userInfo.name}" placeholder="请输入昵称"/>
            </div>
        </div>
    </div>
    <div class="box weui-cells__title" style="position: relative">其他项目
        <div id="hideBut">+</div>
    </div>
    <div id="otherInfo" style="overflow: hidden;display: none">
        <div class="box weui-cells weui-cells_form">
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">所属机构</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" readonly="true" id="organizationId" value="" placeholder="请选择所属机构"/>
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">人员类型</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" readonly="true" id="type" value="${userInfo.typeName}"
                           placeholder="请选择人员类型"/>
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label" for="roomNo">房间号</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="text" id="roomNo" placeholder="请输入房间号" value="${userInfo.roomNo}"/>
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label" for="telephone3">完整手机号</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="number" pattern="[0-9]*" id="telephone3" placeholder="请输入完整手机号"
                           value="${userInfo.telephone3}"/>
                </div>
            </div>

        <#--        <div class="weui-cell">-->
        <#--            <div class="weui-cell__hd"><label class="weui-label" for="telephone2">审务终端号</label></div>-->
        <#--            <div class="weui-cell__bd">-->
        <#--                <input class="weui-input" type="number" pattern="[0-9]*" id="telephone2" placeholder="请输入审务终端号"-->
        <#--                       value="${userInfo.telephone2}"/>-->
        <#--            </div>-->
        <#--        </div>-->

            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label" for="telephone4">固定电话</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="number" pattern="[0-9]*" id="telephone4" placeholder="请输入固定电话"
                           value="${userInfo.telephone4}"/>
                </div>
            </div>

            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label" for="birthday">出生日期</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" type="input" id="birthday" readonly="readonly" placeholder="请输入出生日期"
                           value="${userInfo.birthday?string("yyyy-MM-dd")} &nbsp;"/>
                </div>
            </div>
        </div>
        <div class="box weui-cells__title">不可修改</div>
        <div class="box weui-cells weui-cells_form" style="color: #56b4ea">

            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">认证码</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" readonly="readonly" id="telephone" value="${userInfo.telephone}"/>
                </div>
            </div>

            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">角色</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" readonly="readonly" value="${userInfo.roleName}"/>
                </div>
            </div>

        </div>
    </div>
    <div class="box">
        <a href="javascript:;" class="weui-btn weui-btn_primary" id="submit">保存</a>
    </div>
</div>
</body>
<script>
    var serverConst = {
        type: [
        <#list type as item>
            {code: "${item.code}", name: "${item.name}"},
        </#list>],
        orgList: []
    }
    var orgInfo =${organizationName};
    putOptions(serverConst.orgList, "", orgInfo.list);

    function putOptions(orgSelect, supername, list) {
        if (supername != "") supername = supername + "-";
        for (var i = 0; i < list.length; i++) {
            if (list[i].childrenOrg.length > 0) {
                putOptions(orgSelect, supername + list[i].name, list[i].childrenOrg);
            } else {
                orgSelect.push({
                    code: list[i].id,
                    name: supername + list[i].name
                });
            }
        }
    }

    $("#organizationId").val(baseService.getServerConstNameByCode("orgList",${userInfo.organizationId?c}));
    $("#hideBut").on("click",function(){
        if($("#hideBut").text()=="+"){
            $("#hideBut").text("-")
            $("#otherInfo").slideDown("fast");
        }else{
            $("#hideBut").text("+")
            $("#otherInfo").slideUp("fast");
        }
    })
</script>
</html>